<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta name="GENERATOR" content="PasDoc 0.11.0">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Crispy Plotter Documentation: ParseUtils</title>
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#FF0000">
<h1 class="unit">Unit ParseUtils</h1>
<table class="sections wide_list">
<tr>
<td><a class="section"  href="#%40Description">Description</a></td><td>uses</td><td><a class="section"  href="#%40Classes">Classes, Interfaces, Objects and Records</a></td><td><a class="section"  href="#%40FuncsProcs">Functions and Procedures</a></td><td>Types</td><td>Constants</td><td>Variables</td></tr></table>
<a name="%40Description"></a><h2 class="description">Description</h2>
<p>
ParseUtils contains a lot of parsing functions for reading less complex structures like constants, signs or names.</p>
<a name="%40Uses"></a><h2 class="overview">Overview</h2>
<a name="%40Classes"></a><h3 class="cio">Classes, Interfaces, Objects and Records</h3>
<table class="classestable wide_list">
<tr class="listheader">
<th class="itemname">Name</th>
<th class="itemdesc">Description</th>
</tr>
<tr class="list">
<td class="itemname">Class&nbsp;<a class="bold"  href="ParseUtils.ESyntaxError.html"><code>ESyntaxError</code></a></td>
<td class="itemdesc">ESyntaxError is raised by <a class="normal"  href="Parser.TParser.html">Parser.TParser</a>, when the user enters an invalid expression</td>
</tr>
</table>
<a name="%40FuncsProcs"></a><h3 class="summary">Functions and Procedures</h3>
<table class="summary wide_list">
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#StrToFDef">StrToFDef</a></b>(Value: String; Default: <a   href="ResConst.html#TFloat">TFloat</a>): <a   href="ResConst.html#TFloat">TFloat</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#FToStr">FToStr</a></b>(X: <a   href="ResConst.html#TFloat">TFloat</a>): String;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#IsValidFloatStr">IsValidFloatStr</a></b>(FloatStr: string): Boolean;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#GetOpName">GetOpName</a></b>(pOperator: <a   href="ParseConst.html#TOperatorType">TOperatorType</a>):String;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#OpCompare">OpCompare</a></b>(Op1, Op2: <a   href="ParseConst.html#TOperatorType">TOperatorType</a>):Integer;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>procedure <b><a   href="ParseUtils.html#ExecuteOperation">ExecuteOperation</a></b>(Var A: <a   href="ResConst.html#TFloat">TFloat</a>; Operator: <a   href="ParseConst.html#TOperatorType">TOperatorType</a>; NegSign: Boolean; Operand2: <a   href="ResConst.html#TFloat">TFloat</a>);</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#Token">Token</a></b>(var Expr: string; St, Ed: Integer):<a   href="ParseConst.TToken.html">TToken</a>;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#GetToken">GetToken</a></b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>): String;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#ParseConstant">ParseConstant</a></b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>; var I: Integer; out Value: <a   href="ResConst.html#TFloat">TFloat</a>; AllowSign: Boolean): Integer;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#ParseName">ParseName</a></b>(const AToken:<a   href="ParseConst.TToken.html">TToken</a>; var I:Integer; out Name:<a   href="ParseConst.TToken.html">TToken</a>): Integer;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#ParseBraces">ParseBraces</a></b>(const AToken:<a   href="ParseConst.TToken.html">TToken</a>; var I:Integer; out OpenBr:Integer; out Braces:<a   href="ParseConst.TToken.html">TToken</a>):Integer;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#ParseSign">ParseSign</a></b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>; var I: Integer; out Sign: ShortInt): Integer; overload;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#ParseSign">ParseSign</a></b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>; var I: Integer; out NegSign: Boolean): Integer; overload;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#ParseArg">ParseArg</a></b>(const AToken:<a   href="ParseConst.TToken.html">TToken</a>; Var I:Integer; Out Arg:<a   href="ParseConst.TToken.html">TToken</a>):Integer;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#SkipWhitespace">SkipWhitespace</a></b>(const AToken:<a   href="ParseConst.TToken.html">TToken</a>; Var I:Integer):Integer;</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#ValidTokenPos">ValidTokenPos</a></b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>; I: Integer):Boolean;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>procedure <b><a   href="ParseUtils.html#ResizeToken">ResizeToken</a></b>(var AToken: <a   href="ParseConst.TToken.html">TToken</a>; Diff: Integer);</code></td>
</tr>
<tr class="list2">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#PosFrom">PosFrom</a></b>(SubStr: String; Str: String; Start: Integer): Integer;</code></td>
</tr>
<tr class="list">
<td class="itemcode"><code>function <b><a   href="ParseUtils.html#GenerateErrorMsg">GenerateErrorMsg</a></b>(E: <a   href="ParseUtils.ESyntaxError.html">ESyntaxError</a>):string;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Functions and Procedures</h3>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="StrToFDef"></a><code>function <b>StrToFDef</b>(Value: String; Default: <a   href="ResConst.html#TFloat">TFloat</a>): <a   href="ResConst.html#TFloat">TFloat</a>;</code></td>
</tr>
<tr><td colspan="1">
<p>
Attempts to convert a string to a float number. If the function succeeds, the converted value is returned. Otherwise Default is returned.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="FToStr"></a><code>function <b>FToStr</b>(X: <a   href="ResConst.html#TFloat">TFloat</a>): String;</code></td>
</tr>
<tr><td colspan="1">
<p>
Converts the float value X to a string.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="IsValidFloatStr"></a><code>function <b>IsValidFloatStr</b>(FloatStr: string): Boolean;</code></td>
</tr>
<tr><td colspan="1">
<p>
Checks, if FloatStr contains a valid float value</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="GetOpName"></a><code>function <b>GetOpName</b>(pOperator: <a   href="ParseConst.html#TOperatorType">TOperatorType</a>):String;</code></td>
</tr>
<tr><td colspan="1">
<p>
Returns string symbol of operator</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="OpCompare"></a><code>function <b>OpCompare</b>(Op1, Op2: <a   href="ParseConst.html#TOperatorType">TOperatorType</a>):Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Compares the precedence of two operators. If Op1 has a higher priority than Op2, the return value is a positive number. If Op1 has a lower priority than Op2, the return value is a negative number. If both operators have a equal priority, 0 is returned.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ExecuteOperation"></a><code>procedure <b>ExecuteOperation</b>(Var A: <a   href="ResConst.html#TFloat">TFloat</a>; Operator: <a   href="ParseConst.html#TOperatorType">TOperatorType</a>; NegSign: Boolean; Operand2: <a   href="ResConst.html#TFloat">TFloat</a>);</code></td>
</tr>
<tr><td colspan="1">
<p>
Calculates a term with two operands one operator in the form of A &lt;Operator&gt; &lt;NegSign&gt;Operand2, where A is the first operand, Operator can be +, -, *, /, % (float modulo) or &circ;(power) and NegSign specifies the sign of Operand2 (- or +).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="Token"></a><code>function <b>Token</b>(var Expr: string; St, Ed: Integer):<a   href="ParseConst.TToken.html">TToken</a>;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="GetToken"></a><code>function <b>GetToken</b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>): String;</code></td>
</tr>
<tr><td colspan="1">
&nbsp;</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ParseConstant"></a><code>function <b>ParseConstant</b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>; var I: Integer; out Value: <a   href="ResConst.html#TFloat">TFloat</a>; AllowSign: Boolean): Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Parses a number constant.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ParseName"></a><code>function <b>ParseName</b>(const AToken:<a   href="ParseConst.TToken.html">TToken</a>; var I:Integer; out Name:<a   href="ParseConst.TToken.html">TToken</a>): Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Parses a valid variable/function name.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ParseBraces"></a><code>function <b>ParseBraces</b>(const AToken:<a   href="ParseConst.TToken.html">TToken</a>; var I:Integer; out OpenBr:Integer; out Braces:<a   href="ParseConst.TToken.html">TToken</a>):Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Parses a braced expression. Braces within the expression are ignored.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ParseSign"></a><code>function <b>ParseSign</b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>; var I: Integer; out Sign: ShortInt): Integer; overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Parses a sign at position I and returns it as number (-1 or +1).</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ParseSign"></a><code>function <b>ParseSign</b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>; var I: Integer; out NegSign: Boolean): Integer; overload;</code></td>
</tr>
<tr><td colspan="1">
<p>
Parses a sign at position I and returns it as boolean variable.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ParseArg"></a><code>function <b>ParseArg</b>(const AToken:<a   href="ParseConst.TToken.html">TToken</a>; Var I:Integer; Out Arg:<a   href="ParseConst.TToken.html">TToken</a>):Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Parses an function argument expression delimited by opening/closing brace or an argument seperator (comma by default). The parsed expression my contain braces itself.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="SkipWhitespace"></a><code>function <b>SkipWhitespace</b>(const AToken:<a   href="ParseConst.TToken.html">TToken</a>; Var I:Integer):Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Moves position I over whitespace characters to the first non whitespace character.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ValidTokenPos"></a><code>function <b>ValidTokenPos</b>(const AToken: <a   href="ParseConst.TToken.html">TToken</a>; I: Integer):Boolean;</code></td>
</tr>
<tr><td colspan="1">
<p>
Checks, if position I is pointing into the section AToken.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="ResizeToken"></a><code>procedure <b>ResizeToken</b>(var AToken: <a   href="ParseConst.TToken.html">TToken</a>; Diff: Integer);</code></td>
</tr>
<tr><td colspan="1">
<p>
Adds Diff characters on the left and right side to the selection. For negative values of diff, the selection is contracted.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="PosFrom"></a><code>function <b>PosFrom</b>(SubStr: String; Str: String; Start: Integer): Integer;</code></td>
</tr>
<tr><td colspan="1">
<p>
Searches SubStr in Str, beginning at position Start.</p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="itemcode"><a name="GenerateErrorMsg"></a><code>function <b>GenerateErrorMsg</b>(E: <a   href="ParseUtils.ESyntaxError.html">ESyntaxError</a>):string;</code></td>
</tr>
<tr><td colspan="1">
<p>
Generates syntax error message for end user (with line breaks).</p>
</td></tr>
</table>
<hr noshade size="1"><span class="appinfo"><em>Generated by <a  target="_parent" href="http://pasdoc.sourceforge.net/">PasDoc 0.11.0</a> on 2009-07-25 15:33:04</em>
</span>
</body></html>
